#ifndef __VERTEX_H__
#define __VERTEX_H__

#include "vector3d.h"
#include "matrix.h"
#include "color.h"
#include "halfEdge.h"

#include <iostream>

class Vertex{
    public:
        Vertex(int = 0, const Vector3D & = Vector3D(), const Color & = Color(1, 1, 1, 1), HalfEdge * = NULL);
        ~Vertex(){};

        int getId() const {return id;};
        void setId(int _id) {id = _id;};

        bool isSelected() const {return selected;};
        void select(bool _b) {selected = _b;};

        const Color &getColor() const {return color;};
        void setColor(const Color &_color) {color = _color;};

        const Vector3D &getPosition() const {return position;};
        void setPosition(const Vector3D &_p) {position = _p;};

        HalfEdge *getHE() const {return he;};
        void setHE(HalfEdge *_he) {he = _he;};

        void translate(const Vector3D &);
        void rotate(const Matrix &);
        void scale(const Matrix &);

        void selectAdjacentVertex();
        void selectAdjacentEdge();
        void selectAdjacentFace();

    private:
        int id;
        bool selected;
        Color color;
        Vector3D position;
        HalfEdge *he;
};

#endif
